﻿using Microsoft.Practices.Unity;
using MusicManager.BL;
using MusicManagerDAO.Implementation;
using MusicManagerDAO.Interfaces;
using MusicManager.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MusicManager.Azure
{
    public static class UnityConfig
    {
        public static void RegisterComponents(this IUnityContainer container)
        {
            // DAOs
            container.RegisterType<IMusicDao, MusicDao>(new HierarchicalLifetimeManager());
            container.RegisterType<IUserDao, UserDao>(new HierarchicalLifetimeManager());

            // Business Logic
            container.RegisterType<IMusicManagerBL, MusicManagerBL>(new HierarchicalLifetimeManager());

            // Services
            container.RegisterType<IMusic, MusicManager.Azure.MusicService>(new HierarchicalLifetimeManager());
            container.RegisterType<IUser, MusicManager.Azure.MusicService>(new HierarchicalLifetimeManager());
        }
    }
}